package com.seago.iceberg.api;

import com.seago.iceberg.model.CadPart;
import com.seago.iceberg.repository.CadPartRepository;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Title:
 * <p>
 * description:
 *
 * @Company: 中国船舶集团海舟系统技术有限公司-武汉
 * @author: yangs
 * @since: 2023-05-08 10:00
 * @version: 1.0
 **/
@RestController
@RequestMapping("/cadPart")
public class CadPartApi {

	@Resource
	private CadPartRepository cadPartRepository;


	@PostMapping(value = "/save")
	void save(@RequestBody CadPart cadPart) throws Exception {
		cadPartRepository.save(cadPart);
	}

	@GetMapping("/findAll")
	List<CadPart> findAll() {
		return cadPartRepository.findAll();
	}

	@GetMapping("/getById/{id}")
	List<CadPart> getById(@PathVariable("id") String id) {
		return cadPartRepository.getById(id);
	}


}
